package com.project.estates.service.impl;

import java.util.List;
import com.project.common.utils.DateUtils;
import cn.hutool.core.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.project.estates.mapper.BasicActivityMapper;
import com.project.estates.domain.BasicActivity;
import com.project.estates.service.IBasicActivityService;

/**
 * 基础—活动Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-05
 */
@Service
public class BasicActivityServiceImpl implements IBasicActivityService 
{
    @Autowired
    private BasicActivityMapper basicActivityMapper;

    /**
     * 查询基础—活动
     * 
     * @param id 基础—活动主键
     * @return 基础—活动
     */
    @Override
    public BasicActivity selectBasicActivityById(Long id)
    {
        return basicActivityMapper.selectBasicActivityById(id);
    }

    /**
     * 查询基础—活动列表
     * 
     * @param basicActivity 基础—活动
     * @return 基础—活动
     */
    @Override
    public List<BasicActivity> selectBasicActivityList(BasicActivity basicActivity)
    {
        return basicActivityMapper.selectBasicActivityList(basicActivity);
    }

    /**
     * 新增基础—活动
     * 
     * @param basicActivity 基础—活动
     * @return 结果
     */
    @Override
    public int insertBasicActivity(BasicActivity basicActivity)
    {
        basicActivity.setCreateTime(DateUtils.getNowDate());
        basicActivity.setId(IdUtil.getSnowflake().nextId());
        return basicActivityMapper.insertBasicActivity(basicActivity);
    }

    /**
     * 修改基础—活动
     * 
     * @param basicActivity 基础—活动
     * @return 结果
     */
    @Override
    public int updateBasicActivity(BasicActivity basicActivity)
    {
        basicActivity.setUpdateTime(DateUtils.getNowDate());
        return basicActivityMapper.updateBasicActivity(basicActivity);
    }

    /**
     * 批量删除基础—活动
     * 
     * @param ids 需要删除的基础—活动主键
     * @return 结果
     */
    @Override
    public int deleteBasicActivityByIds(Long[] ids)
    {
        return basicActivityMapper.deleteBasicActivityByIds(ids);
    }

    /**
     * 删除基础—活动信息
     * 
     * @param id 基础—活动主键
     * @return 结果
     */
    @Override
    public int deleteBasicActivityById(Long id)
    {
        return basicActivityMapper.deleteBasicActivityById(id);
    }
}
